<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/4/14
 * Time: 17:53
 */
$fp = stream_socket_client('tcp://127.0.0.0:9001', $error, $errstr, 30);

fwrite($fp, "信息");

Swoole\Event::add($fp, function($fp){
   $resp = fread($fp, 8192);
    var_dump($resp);
   swoole_event_del($fp);
   fclose($fp);
});

echo 'finish'.PHP_EOL;